<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pybindgen.typehandlers.codesink.CodeSink</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pybindgen-module.html">Package&nbsp;pybindgen</a> ::
        <a href="pybindgen.typehandlers-module.html">Package&nbsp;typehandlers</a> ::
        <a href="pybindgen.typehandlers.codesink-module.html">Module&nbsp;codesink</a> ::
        Class&nbsp;CodeSink
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pybindgen.typehandlers.codesink.CodeSink-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class CodeSink</h1><p class="nomargin-top"><span class="codelink"><a href="pybindgen.typehandlers.codesink-pysrc.html#CodeSink">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_pybindge_96" name="uml_class_diagram_for_pybindge_96">
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#__init__" title="Constructor" alt="" coords="157,36,275,55"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#writeln" title="Write one or more lines of code" alt="" coords="157,55,275,73"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#indent" title="Add a certain ammount of indentation to all lines written from now on and &#160;until unindent() is called" alt="" coords="157,73,275,92"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#unindent" title="Revert indentation level to the value before last indent() call" alt="" coords="157,92,275,111"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html" title="Abstract base class for code sinks" alt="" coords="156,11,276,112"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html" title="A code sink that writes to a file&#45;like object" alt="" coords="16,141,107,168"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html" title="A code sink that keeps the code in memory, and can later flush the code to another code sink" alt="" coords="157,141,275,168"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html" title="A code sink that discards all content." alt="" coords="325,141,419,168"/>
</map>
  <img src="uml_class_diagram_for_pybindge_96.gif" alt='' usemap="#uml_class_diagram_for_pybindge_96" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Abstract base class for code sinks</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="pybindgen.typehandlers.codesink.CodeSink-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Constructor</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.codesink-pysrc.html#CodeSink.__init__">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for___init___68-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for___init___68-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for___init___68" name="call_graph_for___init___68">
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#__init__" title="__init__()" alt="" coords="327,61,431,93"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html#__init__" title="FileCodeSink.__init__()" alt="" coords="28,5,255,37"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__" title="MemoryCodeSink.__init__()" alt="" coords="5,61,277,93"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html#__init__" title="NullCodeSink.__init__()" alt="" coords="25,117,257,149"/>
</map>
  <img src="call_graph_for___init___68.gif" alt='' usemap="#call_graph_for___init___68" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="writeln"></a><span class="summary-sig-name">writeln</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">line</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>)</span><br />
      Write one or more lines of code</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.codesink-pysrc.html#CodeSink.writeln">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="indent"></a><span class="summary-sig-name">indent</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">level</span>=<span class="summary-sig-default">4</span>)</span><br />
      Add a certain ammount of indentation to all lines written from now on
      and until unindent() is called</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.codesink-pysrc.html#CodeSink.indent">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_indent_2-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_indent_2-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_indent_2" name="call_graph_for_indent_2">
<area shape="rect" href="pybindgen.container.IterNextWrapper-class.html#generate" title="container.IterNextWrapper.generate()" alt="" coords="101,11,469,43"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#indent" title="indent()" alt="" coords="615,683,708,715"/>
<area shape="rect" href="pybindgen.converter_functions.CToPythonConverter-class.html#generate" title="converter_functions.CToPythonConverter.generate()" alt="" coords="33,67,537,99"/>
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="33,123,537,155"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeGetter-class.html#generate" title="cppattribute.CppInstanceAttributeGetter.generate()" alt="" coords="36,179,535,211"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="37,235,533,267"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeGetter-class.html#generate" title="cppattribute.CppStaticAttributeGetter.generate()" alt="" coords="48,291,523,323"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="49,347,521,379"/>
<area shape="rect" href="pybindgen.cppattribute.PyGetSetDef-class.html#generate" title="cppattribute.PyGetSetDef.generate()" alt="" coords="104,403,467,435"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_copy_method" title="cppclass.CppClass._generate_copy_method()" alt="" coords="72,459,499,491"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_destructor" title="cppclass.CppClass._generate_destructor()" alt="" coords="85,515,485,547"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_methods" title="cppclass.CppClass._generate_methods()" alt="" coords="93,571,477,603"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_tp_richcompare" title="cppclass.CppClass._generate_tp_richcompare()" alt="" coords="61,627,509,659"/>
<area shape="rect" href="pybindgen.cppclass.CppHelperClass-class.html#_generate_forward_declarations" title="cppclass.CppHelperClass._generate_forward_declarations()" alt="" coords="5,683,565,715"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#_scan_namespace_functions" title="gccxmlparser.ModuleParser._scan_namespace_functions()" alt="" coords="13,739,557,771"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#_scan_namespace_types" title="gccxmlparser.ModuleParser._scan_namespace_types()" alt="" coords="31,795,540,827"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#parse_finalize" title="gccxmlparser.ModuleParser.parse_finalize()" alt="" coords="79,851,492,883"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#parse_init" title="gccxmlparser.ModuleParser.parse_init()" alt="" coords="97,907,473,939"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#scan_functions" title="gccxmlparser.ModuleParser.scan_functions()" alt="" coords="75,963,496,995"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#scan_methods" title="gccxmlparser.ModuleParser.scan_methods()" alt="" coords="77,1019,493,1051"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#do_generate" title="module.ModuleBase.do_generate()" alt="" coords="116,1075,455,1107"/>
<area shape="rect" href="pybindgen.overloading.OverloadedWrapper-class.html#generate" title="overloading.OverloadedWrapper.generate()" alt="" coords="76,1131,495,1163"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#indent" title="base.CodeBlock.indent()" alt="" coords="164,1187,407,1219"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" title="base.CodeBlock.write_error_check()" alt="" coords="109,1243,461,1275"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#write_open_wrapper" title="base.ForwardWrapperBase.write_open_wrapper()" alt="" coords="45,1299,525,1331"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#generate" title="base.ReverseWrapperBase.generate()" alt="" coords="101,1355,469,1387"/>
</map>
  <img src="call_graph_for_indent_2.gif" alt='' usemap="#call_graph_for_indent_2" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="unindent"></a><span class="summary-sig-name">unindent</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Revert indentation level to the value before last indent() call</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="pybindgen.typehandlers.codesink-pysrc.html#CodeSink.unindent">source&nbsp;code</a></span>
            <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_unindent_2-summary-div');return false;">call&nbsp;graph</a></span>&nbsp;
          </td>
        </tr>
      </table>
      <div style="display:none" id="call_graph_for_unindent_2-summary-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for_unindent_2" name="call_graph_for_unindent_2">
<area shape="rect" href="pybindgen.container.IterNextWrapper-class.html#generate" title="container.IterNextWrapper.generate()" alt="" coords="101,9,469,41"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#unindent" title="unindent()" alt="" coords="615,653,732,685"/>
<area shape="rect" href="pybindgen.converter_functions.CToPythonConverter-class.html#generate" title="converter_functions.CToPythonConverter.generate()" alt="" coords="33,65,537,97"/>
<area shape="rect" href="pybindgen.converter_functions.PythonToCConverter-class.html#generate" title="converter_functions.PythonToCConverter.generate()" alt="" coords="33,121,537,153"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeGetter-class.html#generate" title="cppattribute.CppInstanceAttributeGetter.generate()" alt="" coords="36,177,535,209"/>
<area shape="rect" href="pybindgen.cppattribute.CppInstanceAttributeSetter-class.html#generate" title="cppattribute.CppInstanceAttributeSetter.generate()" alt="" coords="37,233,533,265"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeGetter-class.html#generate" title="cppattribute.CppStaticAttributeGetter.generate()" alt="" coords="48,289,523,321"/>
<area shape="rect" href="pybindgen.cppattribute.CppStaticAttributeSetter-class.html#generate" title="cppattribute.CppStaticAttributeSetter.generate()" alt="" coords="49,345,521,377"/>
<area shape="rect" href="pybindgen.cppattribute.PyGetSetDef-class.html#generate" title="cppattribute.PyGetSetDef.generate()" alt="" coords="104,401,467,433"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_copy_method" title="cppclass.CppClass._generate_copy_method()" alt="" coords="72,457,499,489"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_destructor" title="cppclass.CppClass._generate_destructor()" alt="" coords="85,513,485,545"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_methods" title="cppclass.CppClass._generate_methods()" alt="" coords="93,569,477,601"/>
<area shape="rect" href="pybindgen.cppclass.CppClass-class.html#_generate_tp_richcompare" title="cppclass.CppClass._generate_tp_richcompare()" alt="" coords="61,625,509,657"/>
<area shape="rect" href="pybindgen.cppclass.CppHelperClass-class.html#_generate_forward_declarations" title="cppclass.CppHelperClass._generate_forward_declarations()" alt="" coords="5,681,565,713"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#_scan_namespace_functions" title="gccxmlparser.ModuleParser._scan_namespace_functions()" alt="" coords="13,737,557,769"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#_scan_namespace_types" title="gccxmlparser.ModuleParser._scan_namespace_types()" alt="" coords="31,793,540,825"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#parse_finalize" title="gccxmlparser.ModuleParser.parse_finalize()" alt="" coords="79,849,492,881"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#parse_init" title="gccxmlparser.ModuleParser.parse_init()" alt="" coords="97,905,473,937"/>
<area shape="rect" href="pybindgen.gccxmlparser.ModuleParser-class.html#scan_methods" title="gccxmlparser.ModuleParser.scan_methods()" alt="" coords="77,961,493,993"/>
<area shape="rect" href="pybindgen.module.ModuleBase-class.html#do_generate" title="module.ModuleBase.do_generate()" alt="" coords="116,1017,455,1049"/>
<area shape="rect" href="pybindgen.overloading.OverloadedWrapper-class.html#generate" title="overloading.OverloadedWrapper.generate()" alt="" coords="76,1073,495,1105"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#unindent" title="base.CodeBlock.unindent()" alt="" coords="152,1129,419,1161"/>
<area shape="rect" href="pybindgen.typehandlers.base.CodeBlock-class.html#write_error_check" title="base.CodeBlock.write_error_check()" alt="" coords="109,1185,461,1217"/>
<area shape="rect" href="pybindgen.typehandlers.base.ForwardWrapperBase-class.html#write_close_wrapper" title="base.ForwardWrapperBase.write_close_wrapper()" alt="" coords="45,1241,525,1273"/>
<area shape="rect" href="pybindgen.typehandlers.base.ReverseWrapperBase-class.html#generate" title="base.ReverseWrapperBase.generate()" alt="" coords="101,1297,469,1329"/>
</map>
  <img src="call_graph_for_unindent_2.gif" alt='' usemap="#call_graph_for_unindent_2" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="pybindgen.typehandlers.codesink-pysrc.html#CodeSink.__init__">source&nbsp;code</a></span>&nbsp;
    <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for___init___68-div');return false;">call&nbsp;graph</a></span>&nbsp;</td>
  </tr></table>
  <div style="display:none" id="call_graph_for___init___68-div"><center>
<table border="0" cellpadding="0" cellspacing="0">
  <tr><td><center>  <map id="call_graph_for___init___68" name="call_graph_for___init___68">
<area shape="rect" href="pybindgen.typehandlers.codesink.CodeSink-class.html#__init__" title="__init__()" alt="" coords="327,61,431,93"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.FileCodeSink-class.html#__init__" title="FileCodeSink.__init__()" alt="" coords="28,5,255,37"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.MemoryCodeSink-class.html#__init__" title="MemoryCodeSink.__init__()" alt="" coords="5,61,277,93"/>
<area shape="rect" href="pybindgen.typehandlers.codesink.NullCodeSink-class.html#__init__" title="NullCodeSink.__init__()" alt="" coords="25,117,257,149"/>
</map>
  <img src="call_graph_for___init___68.gif" alt='' usemap="#call_graph_for___init___68" ismap="ismap" class="graph-without-title" />
</center></td></tr>
  <tr><th>Call Graph</th></tr>
</table><br />
</center></div>

  <p>Constructor</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>sink = MemoryCodeSink()
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln(<span class="py-string">&quot;foo();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln(<span class="py-string">&quot;if (true) {&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>sink.indent()
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln(<span class="py-string">&quot;bar();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>sink.unindent()
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln(<span class="py-string">&quot;zbr();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> sink.flush().rstrip()
<span class="py-output">foo();</span>
<span class="py-output">if (true) {</span>
<span class="py-output">    bar();</span>
<span class="py-output">zbr();</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>sink = MemoryCodeSink()
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln(<span class="py-string">&quot;foo();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln()
<span class="py-prompt">&gt;&gt;&gt; </span>sink.writeln(<span class="py-string">&quot;bar();&quot;</span>)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> len(sink.flush().split(<span class="py-string">&quot;\n&quot;</span>))
<span class="py-output">4</span></pre>
  <dl class="fields">
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pybindgen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Jul 12 17:23:33 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
